/**
 * 
 */
package xj.toolkit.fsm.transformer;

import org.apache.commons.collections4.Transformer;

import xj.toolkit.fsm.FSMContext;


/**
 * @author hp
 *
 */
public abstract class SpecialSnapshotFactory implements Transformer {
	
    protected abstract BaseSnapshot createSnapshot();
    
	/**
	 * @see org.apache.commons.collections.Transformer#transform(java.lang.Object)
	 */
	public Object transform(Object input) {
		BaseSnapshot snapshot = createSnapshot();
		snapshot.setKey( ((FSMContext)input).getKey().toString());
		return	snapshot;
	}

}
